package com.ymttest.database.sqlwapper.CouponShop2cn;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;

import com.ymttest.database.model.CouponShop2cn.couponusecondition;
import com.ymttest.utils.EnvSetup;

public class couponuseconditionWapper {
	SqlManager manager;

    public couponuseconditionWapper() {
        manager = new SqlManager("mysqlcouponshop2cn" + EnvSetup.getEnv());
    }

    public List<couponusecondition> selectByBatchId(Integer BatchId) {
        List<couponusecondition> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.CouponShop2cn.couponuseconditionMapper.selectByBatchId",
                        BatchId);
        manager.commit();
        return result;
    }
    
    public List<couponusecondition> selectByConditionTypeAndBatchId(Integer BatchId,Integer ConditionType) {
    	Map m=new HashMap<String,Object>();
    	m.put("BatchId", BatchId);
    	m.put("ConditionType", ConditionType);
        List<couponusecondition> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.CouponShop2cn.couponuseconditionMapper.selectByConditionTypeAndBatchId",
                        m);
        manager.commit();
        return result;
    }

   

    public static void main(String[] args) {
//       //z YmtCouponWapper test = new YmtCouponWapper();
//
//        System.out.println(test.useCoupon(20238699, "AIL7PT3W1",null));
        // test.insertYmtCouponSetting(3,11);
        // Logger.debug(test.getLastYmtCouponSettingId());


    }
}
